/**
 *******************************************************************************
 * \brief   CAS EBX Project Work "Kaffeemaschine"
 *
 * \file    device.h
 * \version 1.0
 * \date    18.08.2010
 * \author  Liechti Beat
 *
 * \remark  Last Modifications:
 * \remark  V1.0, 18.08.2010   Initial release
 *******************************************************************************
 **/

#ifndef DEVICE_H_
#define DEVICE_H_

/*
 *******************************************************************************
 * Global Type Definition (ADT Structure)
 *******************************************************************************
 */
/** \brief ADT structure for device */
typedef struct _tDevice
{
	/** \brief path of the device (e.g. /dev/c2service) */
	char *path;
	/** \brief file descriptior */
	int fd;
} tDevice;

/*
 *******************************************************************************
 * Global Function Declaration
 *******************************************************************************
 */

extern tDevice *openDeviceRead(char *path);
extern tDevice *openDeviceWrite(char *path);
extern void closeDevice(tDevice *device);
extern int readDevice(tDevice *device, int *val_p);
extern int writeDevice(tDevice *device, int val);

#endif /* DEVICE_H_ */
